<html>
<head>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
    </script>
</head>
<body>

<script>
    $.ajax({
        url:"php.php",
        type:'post',
        data:{
            x:3,
            y:6
        },
        success:function(result){
            console.log(result)
            var res = $.parseJSON(result);
            if(res.status == 1){
                console.log(typeof res,res)
                console.log((res.msg))
                alert('服务器返回的信息：' + res.data.name + '      传过去的参数计算结果是：' + res.data.age)
            }else{
                alert(' 计算失败，原因是：' + res.data.msg)
            }

        }});
</script>
</body>
</html>